#ifndef XITEMCONTAINER_H
#define XITEMCONTAINER_H
#include <xscript/xitem.h>
#include <xscript/xitemvisitor.h>

class XItemContainer : public XItem, public XItemVisitor {
  public:
    XItemContainer();
    virtual ~XItemContainer();
  public:
    void clear() {children.clear();}
    void addItem(const std::shared_ptr<XItem>& item);
    void removeItem(std::shared_ptr<XItem> item);

    virtual void accept(std::shared_ptr<XItemVisitor> visitor)override;
  protected:
    std::list<std::shared_ptr<XItem>> children;
};

#endif // XITEMCONTAINER_H
